//
//  classStruct.hpp
//  learnC++
//
//  Created by liuzhibing on 2018/8/1.
//  Copyright © 2018年 yunfan.com. All rights reserved.
//

#ifndef classStruct_hpp
#define classStruct_hpp

#include <stdio.h>
#include <iostream>
#include <string>

class Struct2 {
    
public:
    Struct2(){
        
    }
    
    virtual ~Struct2(){
        
    }
    
    void printSelf(){
        std::cout << "Struct2" <<std::endl;
    }
    
    std::string m_name;
    
};

struct ClassStruct : public Struct2{
    
    ClassStruct(std::string name,std::string age):m_name(name),m_age(age){
    
    }
    
    ~ClassStruct(){
        
    }
    
    friend std::ostream &operator<< (std::ostream &out,const ClassStruct &c){
        
        out << c.m_name << c.m_age << std::endl;
        return out;
    }
    
public:
    
    std::string m_name;
    std::string m_age;
    
};


class ClassStruct2 : public ClassStruct {
    
    
public:
    
    ClassStruct2(std::string name,std::string age):ClassStruct(name,age){
        
    }
    
    ~ClassStruct2(){
        
    }
};


#endif /* classStruct_hpp */
